package com.steven.frames.imports;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Configuration
//@Import(value = {DoubleCheck.class})  //方案1
//@Import(value = {MyImport.class})  //方案2
@Import(value = {MyImportDefinit.class})  //方案3
public class Import01 {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext annotationConfigApplicationContext = new AnnotationConfigApplicationContext(Import01.class);
        String[] definitionNames = annotationConfigApplicationContext.getBeanDefinitionNames();
        for (String name:definitionNames){
            System.out.println(name);
        }
    }
}
